#include <iostream>
#include <set>

using namespace std;

void printSet(const multiset<double> &st)
{
    for (set<double>::const_iterator it = st.begin(); it != st.end(); it++)
    {
        cout << *it << " ";
    }
    cout << endl;
}

class compare
{
public:
    bool operator()(double v1, double v2)
    {
        return v1 < v2;
    }
};

bool myCompare(double v1, double v2)
{
    return v1 < v2;
}

void printSet1(const set<double, compare> &st)
{
    for (set<double>::const_iterator it = st.begin(); it != st.end(); it++)
    {
        cout << *it << " ";
    }
    cout << endl;
}

void test01()
{
    multiset<double> st;
    st.insert(5);
    st.insert(7);
    st.insert(1);
    st.insert(9);
    st.insert(9);
    printSet(st);
    multiset<double> st1 = st;
    printSet(st1);

    auto pos = st1.find(8);
    int count = st1.count(8);
    cout << *pos << endl;
    cout << count << endl;
    st.erase(st.begin(), --st.end());
    printSet(st);

    set<double, compare> st2;
    st2.insert(5.0);
    st2.insert(7.1);
    st2.insert(1.3);
    st2.insert(9.2);
    st2.insert(0.69);
    printSet1(st2);
}

int main()
{
    test01();
    return 1;
}